<%
   filter_id = widget_properties['filter']
   page_size = widget_properties['pageSize']
   filter = MeasureFilter.find_by_id(filter_id.to_i) if filter_id
   if filter
     filter.load_criteria_from_data
     if !filter.require_authentication? || logged_in?
       filter.set_criteria_value('display', 'list')
       filter.set_criteria_value('pageSize', page_size)
       filter.execute(self, :user => current_user)
       @widget_title = link_to h(filter.name), {:controller => 'measures', :action => 'filter', :id => filter.id}
%>

  <% if widget_properties['displayFilterDescription'] && !filter.description.blank? %>
    <div style="padding-bottom: 5px">
      <span class="note"><%= h filter.description -%></span>
    </div>
  <% end %>

    <%= render :partial => 'measures/display_list', :locals => {:edit_mode => false, :filter => filter, :widget_id => widget.id} -%>
<%
     end
   else
%>
  <p><%= image_tag 'warning.png' %> <%= message 'measure_filter.widget.unknown_filter_warning' -%></p>
<%
   end
%>
